package com.apexedu.biz.entity.client;

import java.util.ArrayList;
import java.util.List;

/**
 * 用于客户端和服务端数据传输的对象。包含了资源属性、授权属性
 * User: 杨建亮
 * Date: 13-11-12  下午10:26
 */
public class ResourceEntity extends AuthBaseEntity {
    private String srcId; // 被访问的资源编号。业务系统中这个资源的编号。
    private String srcTitle; // 资源标题/名称
    private String srcType; // 资源类型
    private String appId; // 资源所属的业务系统
    private String userLoginId; // 访问人的登录账号
    private String roleName; // 访问人的角色名称
    private String srcRealUrl; // 鉴权结果：返回资源的真实地址
    private String srcUpId; // 资源的上级的编码（比如菜单）
    private boolean hasRights; // 鉴权结果：是否有权访问

    private List<RuleSummaryEntity> ruleEntities = null; // 该资源对应的所有的规则说明文档（内部有url地址，也可以调这个url地址来展示）

    public String getSrcId() {
        return srcId;
    }

    public void setSrcId(String srcId) {
        this.srcId = srcId;
    }

    public String getSrcType() {
        return srcType;
    }

    public void setSrcType(String srcType) {
        this.srcType = srcType;
    }

    public String getSrcTitle() {
        return srcTitle;
    }

    public void setSrcTitle(String srcTitle) {
        this.srcTitle = srcTitle;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getUserLoginId() {
        return userLoginId;
    }

    public void setUserLoginId(String userLoginId) {
        this.userLoginId = userLoginId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public boolean isHasRights() {
        return hasRights;
    }

    public void setHasRights(boolean hasRights) {
        this.hasRights = hasRights;
    }

    public String getSrcRealUrl() {
        return srcRealUrl;
    }

    public void setSrcRealUrl(String srcRealUrl) {
        this.srcRealUrl = srcRealUrl;
    }

    public String getSrcUpId() {
        return srcUpId;
    }

    public void setSrcUpId(String srcUpId) {
        this.srcUpId = srcUpId;
    }

    public List<RuleSummaryEntity> getRuleEntities() {
        if( ruleEntities==null ){
            ruleEntities = new ArrayList<RuleSummaryEntity>();
        }
        return ruleEntities;
    }

    public void setRuleEntities(List<RuleSummaryEntity> ruleEntities) {
        this.ruleEntities = ruleEntities;
    }
}
